#include <iostream>
#include <string>
using namespace std;

int a[10]={30,20,40,34,78,23,55,67,43,13};


string s[10]={"Gabrovo","Varna","Sofia","Pleven","Burgas",
              "Plovdiv","Sozopol","Nesebar","Haskovo","London"};

template<typename T>
int search(T a[], int p, int q, T x)
{ for(int i=p; i<=q; i++)
    if(x==a[i]) return i;
  return -1;
}    

int main()
{ 
  cout << search(a,0,9,34) << endl;
  cout << search(a,0,9,35) << endl;
  
  string x="Haskovo";  
  cout << search(s,0,9,x) << endl;
  x="Ruse";
  cout << search(s,0,9,x) << endl;

  return 0;
}
  


